﻿using System.Windows.Forms;
using GeoSketch2.Core;

namespace GeoSketch2.Archaeo
{
    public partial class TBBExcavationSquareCreationPolyline : BaseToolbarButton
    {
        #region Constructor
        /// <summary>
        /// The toolbar button of the excavation square creation tool using a polyline
        /// </summary>
        public TBBExcavationSquareCreationPolyline()
        {
            InitializeComponent();
            ToolTipText = "Polyline";
        } 
        #endregion

        #region Events
        /// <summary>
        /// The event on the mouse click on the button
        /// </summary>
        protected override void OnMouseClick(object sender, MouseEventArgs e)
        {
            BaseTool tool = this.Tool;

            SetTool(tool, sender, e);

            ((TBExcavationSquareCreation)Parent).CurrentTool = tool;
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets the tool assigned to the button
        /// </summary>
        protected override BaseTool Tool
        {
            get
            {
                return new TExcavationSquareCreationPolyline((Viewport)DisplayBox.Viewport);
            }
        }
        #endregion
    }
}
